package R.Service;

import R.Dao.RegDao;
import R.Dao.SickDao;
import R.Entity.Diagnosis;
import R.Entity.Record;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "SickDelServlet", value = "/SickDelServlet")
public class SickDelServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        //获取传递参数
        String card_number=request.getParameter("card_number");
        Diagnosis d=new Diagnosis();
        d.setCard_number(card_number);
        int sta= SickDao.delD(d);
        if (sta>0){
            response.sendRedirect("/SickShowAll");
        }else {
            response.sendRedirect("/SickShowAll");
        }
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
